Why am I getting cannot find symbol errors in my Java code